from rest_framework import serializers
from .models import *

from rest_framework import serializers
from .models import *


class GradeSer(serializers.ModelSerializer):
    class Meta:
        model = GradeModel
        fields = '__all__'


class UserSer(serializers.ModelSerializer):
    class Meta:
        model = UserModel
        fields = '__all__'


class UserInfoSer(serializers.ModelSerializer):
    class Meta:
        model = UserInfoModel
        fields = '__all__'


class AuthorSer(serializers.ModelSerializer):
    class Meta:
        model = AuthorModel
        fields = '__all__'


class CateSer(serializers.ModelSerializer):
    class Meta:
        model = CateModel
        fields = '__all__'


class FictionSer(serializers.ModelSerializer):
    class Meta:
        model = FictionModel
        fields = '__all__'

    img = serializers.ImageField(use_url=False)  # 默认不加前缀


class SectionSer(serializers.ModelSerializer):
    class Meta:
        model = SectionModel
        fields = '__all__'
